/*******************************************************************************
 * This file is part of blueprint4j www.blueprint4j.org.
 * 
 *     blueprint4j is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     blueprint4j is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 * 
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with blueprint4j. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package blueprint4j.utils;

import java.math.BigDecimal;

public class Currency implements java.io.Serializable {

	private BigDecimal value = new BigDecimal("0");

	public Currency(String p_value) {
		value = new BigDecimal(p_value);
	}

	public Currency(BigDecimal p_value) {
		value = p_value;
	}

	public BigDecimal getBigDecimal() {
		return value;
	}

	public String toString() {
		return value.toString();
	}
	
	public boolean equals(Object object) {
		if (value == null) {
			return object == null;
		}
		if (object == null) {
			return value == null;
		}
		return value.toString().equals(object.toString());
	}

}
